package com.ruoyi.car.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.ShopCarMapper;
import com.ruoyi.car.domain.ShopCar;
import com.ruoyi.car.service.IShopCarService;

/**
 * 购物车Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-06
 */
@Service
public class ShopCarServiceImpl implements IShopCarService 
{
    @Autowired
    private ShopCarMapper shopCarMapper;

    /**
     * 查询购物车
     * 
     * @param id 购物车主键
     * @return 购物车
     */
    @Override
    public ShopCar selectShopCarById(Long id)
    {
        return shopCarMapper.selectShopCarById(id);
    }

    /**
     * 查询购物车列表
     * 
     * @param shopCar 购物车
     * @return 购物车
     */
    @Override
    public List<ShopCar> selectShopCarList(ShopCar shopCar)
    {
        return shopCarMapper.selectShopCarList(shopCar);
    }

    /**
     * 新增购物车
     * 
     * @param shopCar 购物车
     * @return 结果
     */
    @Override
    public int insertShopCar(ShopCar shopCar)
    {
        return shopCarMapper.insertShopCar(shopCar);
    }

    /**
     * 修改购物车
     * 
     * @param shopCar 购物车
     * @return 结果
     */
    @Override
    public int updateShopCar(ShopCar shopCar)
    {
        return shopCarMapper.updateShopCar(shopCar);
    }

    /**
     * 批量删除购物车
     * 
     * @param ids 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteShopCarByIds(Long[] ids)
    {
        return shopCarMapper.deleteShopCarByIds(ids);
    }

    /**
     * 删除购物车信息
     * 
     * @param id 购物车主键
     * @return 结果
     */
    @Override
    public int deleteShopCarById(Long id)
    {
        return shopCarMapper.deleteShopCarById(id);
    }
}
